package com.cpx.feign;

import com.cpx.dto.MenuDto;
import com.cpx.dto.ShiroAuthoDto;
import com.cpx.feign.hystrix.EmployeeHystrix;
import com.cpx.po.Employee;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Auther: PanBin
 * @Date: 2018-9-5 14:41
 * @Description:
 * @Version: 1.0
 */
@FeignClient(name = "CPX-MANAGER-SERVICE",fallback = EmployeeHystrix.class)
public interface EmployeeFeign {

    /**
     * @Author: PanBin
     * @Description: 通过员工名查询员工
     * @CreateDate: 2018-9-5 15:11
     * @Param [username]
     * @Return com.cpx.po.CpxUser
     */
    @RequestMapping(value = "/employee/findEmployeeByUsername",method = RequestMethod.POST)
    Employee findEmployeeByUsername(@RequestParam("username") String username);

    /**
     * @Author: PanBin
     * @Description: 通过员工id获取用户的shiro权限数据
     * @CreateDate: 2018-11-13 11:26
     * @Param [id]
     * @Return com.cpx.dto.ShiroAuthoDto
     */
    @RequestMapping(value = "/employee/getAuthcListByEmployeeId",method = RequestMethod.POST)
    ShiroAuthoDto getAuthcListByEmployeeId(@RequestParam("id") Integer id);

    /**
     * @Author: PanBin
     * @Description: 获取员工的权限菜单列表
     * @CreateDate: 2018-11-13 11:26
     * @Param [employeeId]
     * @Return java.util.List<com.cpx.dto.MenuDto>
     */
    @RequestMapping(value = "/employee/getMenuByEmployeeId",method = RequestMethod.POST)
    List<MenuDto> getMenuByEmployeeId(@RequestParam("employeeId") Integer employeeId);
}
